<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<title>SMM·支付 管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author">
<link href="${request.getContextPath()}/Public/assets/admin/css/css.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/fancybox/source/jquery.fancybox.css" rel="stylesheet" type="text/css"/>
<link href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css" id="style_components" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/css/plugins.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/layout.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color">
<link href="${request.getContextPath()}/Public/assets/admin/css/custom.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.css" />
<link href="${request.getContextPath()}/Public/assets/admin/css/common.css" rel="stylesheet" type="text/css">
<link href="${request.getContextPath()}/Public/assets/global/css/kkpager.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="${request.getContextPath()}/Public/favicon.ico">

<script>
	BASE_URL = '${request.getContextPath()}'
</script>
<style type="text/css">

.table-condensed {
	width: 100%;
}

.datepicker-inline {
	width: 100%;
}

.col-md-4,.col-md-6,.col-md-7,.col-md-12 {
	padding-right: 0px;
	padding-left: 0px;
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
  border-bottom: 1px solid #ddd;
}
</style>

</head>

<body class="page-header-top-fixed page-footer-fixed">
	
	<div class="page-header">
		<!--头部开始-->
		<#include "/include/top.html" />
		<!-- 头部信息结束 -->
	</div>
	
	<div class="clearfix">
	</div>
	<div class="page-container">
		<#include "/include/menu.html" />
		<!-- 首页内容开始 -->
		<div class="page-content-wrapper">
		<div class="page-content" >
			<div class="container-fluid">
				<div class="col-md-12" style="margin-top: 50px;">
					<div class="row">
						<div class="col-md-12">
							<div class="portlet light">
									<div class="portlet-body">
										<div  style="margin-top: -4%;">
										<input type="hidden" id="dstatus" value="${dstatus}">
											<div style="float: left;" class="col-md-6">
												<div class="btn-group btn-group-justified" > 
													<a href="#" id="a-1" value="-1" onclick="openStatus(-1);" 
															<#if dstatus?? && dstatus==-1>class="btn red"<#else>class="btn btn-default"</#if>>全部</a>
													<a href="#" id="a0" value="0" onclick="openStatus(0);" 
															<#if dstatus?? && dstatus==0>class="btn red"<#else>class="btn btn-default"</#if>>待审核</a>
													<a href="#" id="a1" value="1" onclick="openStatus(1);" 
															<#if dstatus?? && dstatus==1>class="btn red"<#else>class="btn btn-default"</#if>>已通过</a>
													<a href="#" id="a2" value="2" onclick="openStatus(2);" 
															<#if dstatus?? && dstatus==2>class="btn red"<#else>class="btn btn-default"</#if>>已拒绝</a>
												</div>
											</div>
											<div style="float: right;">
												<label>商城审核时间:<input type="search" class="form-control input-small2 input-inline" placeholder="开始时间" name="startTime" id="startTime"  
														onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" <#if startTime??>value="${startTime}"</#if> >
												</label>
													至
												<label><input type="search" class="form-control input-small2 input-inline" placeholder="结束时间" name="endTime" id="endTime"  
														onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" onchange="selList();" <#if endTime??>value="${endTime}"</#if> >
												</label>
											</div>
										</div>
										<div style="margin-top: 5%;">			
										<table class="table table-striped table-bordered table-hover">
											<thead>
											<tr>
												<th scope="col">交易编号</th>
												<th scope="col">详情</th>
												<th scope="col">收款方</th>
												<th scope="col">付款方</th>
												<th scope="col">商城审核人</th>
												<th scope="col">交易金额</th>
												<th scope="col">冻结金额</th>
												<th scope="col">审核时间</th>
												<th scope="col">状态</th>
												<th scope="col">操作</th>
											</tr>
											</thead>
											<tbody>
											<#list tplist as tp>
											 <tr>
											 	<td  class="center">${tp.paymentNo}</td>
											 	<td  class="center">${tp.productName}</td>
											 	<td  class="center">${tp.sellerCompanyName}</td>
											 	<td  class="center">${tp.buyerCompanyName}</td>
											 	<td  class="center">${tp.businessAuditUser}</td>
											 	<td  class="center">¥${tp.dealMoney?string(',###.##')}</td>
											 	<td  class="center">¥${tp.freezeMoney?string(',###.##')}</td>
											 	<td  class="center">${tp.mallAuditTime}</td>
											 	<td  class="center">
											 	<#if tp.auditStatus??&&tp.auditStatus==0>
											 	待审核
											 	<#elseif tp.auditStatus??&&tp.auditStatus==1>
											 	已通过
											 	<#elseif tp.auditStatus??&&tp.auditStatus==2>
											 	已拒绝
											 	</#if>
											 	</td>
											 	<td>
											 	<#if tp.auditStatus??&&tp.auditStatus==0>
											 	<a href="${request.getContextPath()}/transactionPayment/detail.do?id=${tp.confirmId}"><font color="blue">审核</font></a>
											 	<#else>
											 	<a href="${request.getContextPath()}/transactionPayment/detail.do?id=${tp.confirmId}"><font color="blue">查看</font></a>
											 	</#if>
											 	</td>
											 </tr>
										</#list>
											</tbody>
										</table>
									</div>
									</div>	
									<div style="width:80%;margin:0 auto;">
										<div id="kkpager"></div>
										<input type="hidden" value="${totalPage}" id="totalPage">
										<input type="hidden" value="${totalRecords}" id="totalRecords">
									</div>
								</div>
							</div>
						</div>	
					</div>
				</div>
			</div>
		</div>
		<!-- END PAGE CONTENT -->
	</div>
	<!-- END PAGE CONTAINER -->
	<!-- 底部开始 -->

	<!-- 底部结束 -->

	<!--[if lt IE 9]>
<script src="${request.getContextPath()}/Public/assets/global/plugins/respond.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/excanvas.min.js"></script>
<![endif]-->
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker-index.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/highcharts.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js" type="text/javascript"></script>
	<script src="${request.getContextPath()}/Public/assets/global/plugins/fancybox/source/jquery.fancybox.pack.js" type="text/javascript"></script>
	<script type="text/javascript" src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>
	
	<script>
		jQuery(document).ready(function() {

			Metronic.init(); // init metronic core componets
			Layout.init(); // init layout
			//IndexComponent.init(); // init index component
			
// 			removeVal();
		});
		
		//初始化分页插件
		function getParameter(name) { 
			var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
			var r = window.location.search.substr(1).match(reg); 
			if (r!=null) return unescape(r[2]); return null;
		}
		//init
		$(function(){
// 			页面搜索条件
			var dstatus= $('#dstatus').val();
			var startTime= $('#startTime').val();
			var endTime= $('#endTime').val();
			
			var totalPage = $('#totalPage').val();
			var totalRecords = $('#totalRecords').val();
			var pageNo = getParameter('pno');
			if(!pageNo){
				pageNo = 1;
			}
			//生成分页
			//有些参数是可选的，比如lang，若不传有默认值
			kkpager.generPageHtml({
				pno : pageNo,
				//总页码
				total : totalPage,
				//总数据条数
				totalRecords : totalRecords,
				
				getLink : function(n){
					return this.hrefFormer + this.hrefLatter + "?pno="+n+"&startTime="+startTime+"&endTime="+endTime+"&dstatus="+dstatus;
				}	
			});
		});
		
		//页面搜索区域
		function selList(){
			var startTime= $('#startTime').val();
			var endTime= $('#endTime').val();
			var dstatus= $('#dstatus').val();
			var url=BASE_URL+"/transactionPayment/list.do?startTime="+startTime+"&endTime="+endTime+"&dstatus="+dstatus;
			window.location =url;
		}
		function openStatus(status){
			var startTime= $('#startTime').val();
			var endTime= $('#endTime').val();
			
			if(status==-1){
				$('#a-1').attr("class","btn red");
				$('#a0').attr("class","btn btn-default");
				$('#a1').attr("class","btn btn-default");
				$('#a2').attr("class","btn btn-default");
				
			}else if(status==0){
				$('#a0').attr("class","btn red");
				$('#a-1').attr("class","btn btn-default");
				$('#a1').attr("class","btn btn-default");
				$('#a2').attr("class","btn btn-default");
			}else if(status==1){
				$('#a1').attr("class","btn red");
				$('#a-1').attr("class","btn btn-default");
				$('#a0').attr("class","btn btn-default");
				$('#a2').attr("class","btn btn-default");
			}else if(status==2){
				$('#a2').attr("class","btn red");
				$('#a-1').attr("class","btn btn-default");
				$('#a0').attr("class","btn btn-default");
				$('#a1').attr("class","btn btn-default");
			}
			var url=BASE_URL+"/transactionPayment/list.do?startTime="+startTime+"&endTime="+endTime+"&dstatus="+status;
			window.location =url;
		}
	</script>
</body>
</html>